Convert underscores in keyval names to spaces. (#131480)
authorOwen Taylor <otaylor@redhat.com>
Tue, 24 Feb 2004 22:59:51 +0000 (22:59 +0000)
committerOwen Taylor <otaylor@src.gnome.org>
Tue, 24 Feb 2004 22:59:51 +0000 (22:59 +0000)
Tue Feb 24 17:51:49 2004  Owen Taylor  <otaylor@redhat.com>

        * gtk/gtkaccellabel.c (gtk_accel_label_refetch): Convert
        underscores in keyval names to spaces. (#131480)

ChangeLog
ChangeLog.pre-2-10
ChangeLog.pre-2-4
ChangeLog.pre-2-6
ChangeLog.pre-2-8
gtk/gtkaccellabel.c

index 307e14eb01d90cd6ae4adef10bd2d6a13bc0c39f..42b6d0966740f8c52d4f951777296945712535ef 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Tue Feb 24 17:51:49 2004  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkaccellabel.c (gtk_accel_label_refetch): Convert
+       underscores in keyval names to spaces. (#131480)
+
 Tue Feb 24 17:35:59 2004  Owen Taylor  <otaylor@redhat.com>
 
        * m4macros/gtk-2.0.m4: Add some quotes around ***. (#130073,
index 307e14eb01d90cd6ae4adef10bd2d6a13bc0c39f..42b6d0966740f8c52d4f951777296945712535ef 100644 (file)
@@ -1,3 +1,8 @@
+Tue Feb 24 17:51:49 2004  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkaccellabel.c (gtk_accel_label_refetch): Convert
+       underscores in keyval names to spaces. (#131480)
+
 Tue Feb 24 17:35:59 2004  Owen Taylor  <otaylor@redhat.com>
 
        * m4macros/gtk-2.0.m4: Add some quotes around ***. (#130073,
index 307e14eb01d90cd6ae4adef10bd2d6a13bc0c39f..42b6d0966740f8c52d4f951777296945712535ef 100644 (file)
@@ -1,3 +1,8 @@
+Tue Feb 24 17:51:49 2004  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkaccellabel.c (gtk_accel_label_refetch): Convert
+       underscores in keyval names to spaces. (#131480)
+
 Tue Feb 24 17:35:59 2004  Owen Taylor  <otaylor@redhat.com>
 
        * m4macros/gtk-2.0.m4: Add some quotes around ***. (#130073,
index 307e14eb01d90cd6ae4adef10bd2d6a13bc0c39f..42b6d0966740f8c52d4f951777296945712535ef 100644 (file)
@@ -1,3 +1,8 @@
+Tue Feb 24 17:51:49 2004  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkaccellabel.c (gtk_accel_label_refetch): Convert
+       underscores in keyval names to spaces. (#131480)
+
 Tue Feb 24 17:35:59 2004  Owen Taylor  <otaylor@redhat.com>
 
        * m4macros/gtk-2.0.m4: Add some quotes around ***. (#130073,
index 307e14eb01d90cd6ae4adef10bd2d6a13bc0c39f..42b6d0966740f8c52d4f951777296945712535ef 100644 (file)
@@ -1,3 +1,8 @@
+Tue Feb 24 17:51:49 2004  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkaccellabel.c (gtk_accel_label_refetch): Convert
+       underscores in keyval names to spaces. (#131480)
+
 Tue Feb 24 17:35:59 2004  Owen Taylor  <otaylor@redhat.com>
 
        * m4macros/gtk-2.0.m4: Add some quotes around ***. (#130073,
index 5af947a45d7bb864d49cf324c98dac62df1a3b4f..86b993a669e844df2d4cb3a13a2b4989a400c7ae 100644 (file)
@@ -503,6 +503,19 @@ gtk_accel_label_get_string (GtkAccelLabel *accel_label)
   return accel_label->accel_string;
 }
 
+/* Underscores in key names are better displayed as spaces
+ * E.g., Page_Up should be "Page Up"
+ */
+static void
+substitute_underscores (char *str)
+{
+  char *p;
+
+  for (p = str; *p; p++)
+    if (*p == '_')
+      *p = ' ';
+}
+
 gboolean
 gtk_accel_label_refetch (GtkAccelLabel *accel_label)
 {
@@ -577,6 +590,7 @@ gtk_accel_label_refetch (GtkAccelLabel *accel_label)
              tmp = gtk_accelerator_name (key->accel_key, 0);
              if (tmp[0] != 0 && tmp[1] == 0)
                tmp[0] = g_ascii_toupper (tmp[0]);
+             substitute_underscores (tmp);
              g_string_append (gstring, tmp);
              g_free (tmp);
            }